package testes;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

import codigoBase.MyBinarySearch;
import codigoBase.MyLinearSearch;

public class MyBinarySearchTeste {

	
	private MyBinarySearch myBS;
	
	
	@Before
	public void setUp(){
		myBS = new MyBinarySearch();
		Assert.assertNotNull(myBS);
	}	
	
	
		
		@Test
		public void testBinarySearch() {
		
			int[] arr = {1,2,3,4,5,6}; //tamanho 6
			int key1 = 4;
			int key2 = 100;
			Assert.assertEquals(3, myBS.binarySearch(arr, key1));
			Assert.assertEquals(-1, myBS.binarySearch(arr, key2));
		
		
		}

	

}
